<?php
  include('../includes.php');
  
  session_start();
  $membership = new Membership();

  if (isset($_GET['status']) && $_GET['status'] == 'loggedout')
    $membership->logout();

  if ($_POST && !empty($_POST['naam']) && !empty($_POST['wachtwoord']))
    $response = $membership->validate_user(mysql_real_escape_string($_POST['naam']), mysql_real_escape_string($_POST['wachtwoord']));

  include('../header.php');
?>
<div id="login">
	<form method="post" action="">
    <h3>Administratie Login</h3>
    <ul>
      <li>
        <label>Admin Naam</label>
        <input type="text" name="naam">
      </li>
      <li>
        <label>Wachtwoord</label>
        <input type="password" name="wachtwoord">
      </li>
    </ul>
    
    <input type="submit" id="submitButton" value="Inloggen" name="submit">
  </form>
  <?php if(isset($response)) echo "<h4 class='alert'>" . $response . "</h4>"; ?>
</div>
<?php include('../footer.php'); ?>